﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using Housing;

public partial class ManageCenter_ManageApplyItem : System.Web.UI.Page
{
    SystemItems systemitem = new SystemItems();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            systemitem.GetNewestSystemItem();
            if (systemitem!=null)
            {
                lblid.Text = Convert.ToString(systemitem.Sys_id);
                txbavgincome.Text = systemitem.Sys_avgincome;
                txbtotlepro.Text = systemitem.Sys_totlepro;
                txbrentstandard.Text = systemitem.Sys_otherrentstandard;
                txblowrentstandard.Text = systemitem.Sys_lowrentstandard;
                txbonlyonearea.Text = systemitem.Sys_onlyonearea;
                txbavgarea.Text = systemitem.Sys_avgarea;
                txbstandardlowarea.Text = systemitem.Sys_standardlowarea;
            }
        }
    }
    protected void btnupdate_Click(object sender, EventArgs e)
    {
        systemitem = new SystemItems();
        systemitem.Sys_avgincome=txbavgincome.Text;
        systemitem.Sys_totlepro=txbtotlepro.Text;
        systemitem.Sys_otherrentstandard=txbrentstandard.Text;
        systemitem.Sys_lowrentstandard=txblowrentstandard.Text;
        systemitem.Sys_onlyonearea=txbonlyonearea.Text;
        systemitem.Sys_avgarea=txbavgarea.Text;
        systemitem.Sys_standardlowarea=txbstandardlowarea.Text;
        systemitem.Sys_updatedate = DateTime.Now.ToString();
        systemitem.Sys_username="admin";
        if (systemitem.AddNewSystemItem(systemitem))
            WebHelper.AlertAndRefresh("修改成功,请确保参数设置是否正确");
        else
            WebHelper.Alert("无权修改或修改失败，请重新操作！");
    }
}
